import request from '@/config/axios'

// 获取标签列表
export const getTagList = () => {
  return request.get({ url: '/openApi/getProjectOfAllTags' })
}

// 通过标签Id获取项目信息
export const getProjectByTagId = (params) => {
  return request.get({ url: '/openApi/getProjectByTagId', params })
}

//通过名称模糊查询项目信息
export const getProjectByName = (params) => {
  return request.get({ url: '/openApi/getProjectByName', params })
}

//查询开放文档接口目录
export const apiTree = (params) => {
  return request.get({ url: '/openApi/apiTree', params })
}

// 导出接口
export const exportApi = (params) => {
  return request.download({ url: '/api/exportApi', params })
}

// 克隆接口
export const cloneApi = (data) => {
  return request.post({ url: '/api-publish/clone', data })
}

// 查询标签详情
export const getTagData = (id: number) => {
  return request.get({ url: '/projectTag/query?id=' + id })
}

// 新增标签
export const createTagData = (params) => {
  return request.get({ url: '/projectTag/add', params })
}

// 修改标签
export const updateTagData = (params) => {
  return request.get({ url: '/projectTag/update', params })
}

// 删除标签
export const deleteTagData = (id: number) => {
  return request.get({ url: '/projectTag/delete?id=' + id })
}
